import 'package:boss/color_constant.dart';
import 'package:boss/models/takeout_order_list_data.dart';
import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/page/takeoutManagement/constant/takeout_status.dart';
import 'package:boss/ui/page/takeoutManagement/page/takeoutList/widget/delivery_message.dart';
import 'package:boss/ui/page/takeoutManagement/page/takeoutList/widget/orderer_message.dart';
import 'package:boss/ui/widget/shadow_radius_card.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class TakeoutBasePanel extends StatelessWidget {
  final TakeoutOrderItem data;
  final bool isRebackOrder;

  const TakeoutBasePanel({
    Key key,
    this.data,
    this.isRebackOrder = false,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ShadowRadiusCard(
      child: Column(
        children: <Widget>[
          Container(
            height: 82.w,
            padding: EdgeInsets.symmetric(horizontal: 20.w),
            decoration: BoxDecoration(
                color: ColorConstant.ff5770f6.withOpacity(0.1),
                borderRadius: BorderRadius.only(
                  topLeft: Radius.circular(10.w),
                  topRight: Radius.circular(10.w),
                )),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: <Widget>[
                Row(
                  children: <Widget>[
                    Text('#${data.takeNo}', style: TextStyleConstant().blue_36),
                    if (data.type == TakeoutStatus.SELF_PICK)
                      Container(
                        margin: EdgeInsets.only(left: 15.w),
                        child: Text(
                          '自取',
                          style: TextStyleConstant().origin_28,
                        ),
                      ),
                    Container(
                      margin: EdgeInsets.only(left: 20.w),
                      child: Text(
                        '下单时间：${data.ctime}',
                        style: TextStyleConstant().normal_2_26,
                      ),
                    ),
                  ],
                ),
                Text(data.statusName, style: TextStyleConstant().blue_24),
              ],
            ),
          ),
          OrdererMessage(data: data),
          DeliverMessage(
            data: data,
          ),
        ],
      ),
    );
  }
}
